From: Frediano Ziglio Date: Tue, 3 Mar 2015 15:41:15 +0000 (+0000) Subject: xen/arm: Force dom0 to use normal GICv2 driver on Hip04 platform X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3666 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1306dbdf9551d59ff0cea39925f3e593acb86d1e;p=xen.git xen/arm: Force dom0 to use normal GICv2 driver on Hip04 platform Until vGIC support is not implemented and tested, this will prevent guest kernels to use their Hip04 driver, or crash when they don't have any. Signed-off-by: Frediano Ziglio Acked-by: Ian Campbell --- diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c index 0fda957d88..073ad33712 100644 --- a/xen/arch/arm/gic-hip04.c +++ b/xen/arch/arm/gic-hip04.c @@ -612,17 +612,21 @@ static int hip04gic_make_dt_node(const struct domain *d, const struct dt_device_node *node, void *fdt) { const struct dt_device_node *gic = dt_interrupt_controller; - const void *compatible = NULL; + const void *compatible; u32 len; const __be32 *regs; int res = 0; - compatible = dt_get_property(gic, "compatible", &len); - if ( !compatible ) - { - dprintk(XENLOG_ERR, "Can't find compatible property for the gic node\n"); - return -FDT_ERR_XEN(ENOENT); - } + /* + * Replace compatibility string with a standard one. + * dom0 will see a compatible GIC. This as GICC is compatible + * with standard one and GICD (emulated by Xen) is compatible + * to standard. Otherwise we should implement HIP04 GICD in + * the virtual GIC. + * This actually limit CPU number to 8 for dom0. + */ + compatible = DT_COMPAT_GIC_CORTEX_A15; + len = strlen((char*) compatible) + 1; res = fdt_begin_node(fdt, "interrupt-controller"); if ( res ) diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 6f5767f6a5..89a9b6f635 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -153,8 +153,10 @@ #include #include +#define DT_COMPAT_GIC_CORTEX_A15 "arm,cortex-a15-gic" + #define DT_MATCH_GIC_V2 \ - DT_MATCH_COMPATIBLE("arm,cortex-a15-gic"), \ + DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A15), \ DT_MATCH_COMPATIBLE("arm,cortex-a7-gic"), \ DT_MATCH_COMPATIBLE("arm,gic-400")